package com.linian.pushforcampus.mapper;

import com.linian.pushforcampus.domain.Student;
import org.apache.ibatis.annotations.*;

@Mapper
public interface StudentMapper {
    @Insert("INSERT INTO student (user_id, student_id, student_name, password, update_time, create_time) " +
            "VALUES (#{userId}, #{studentId}, #{studentName}, #{password}, #{updateTime}, #{createTime})")
    void insertStudent(Student student);

    @Update("UPDATE student SET user_id = #{userId}, student_id = #{studentId}, student_name = #{studentName}, " +
            "password = #{password}, update_time = #{updateTime} WHERE id = #{id}")
    void updateStudent(Student student);

    @Delete("DELETE FROM student WHERE id = #{id}")
    void deleteStudent(int id);

    @Select("SELECT * FROM student WHERE id = #{id}")
    Student getStudentById(int id);
}
